package k1;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/**
 * 
 * @author Kaspar Falkenberg
 *
 */
public class Algorithm {
	public Algorithm() throws IOException{
		int numbers;
		Esimene esimene = new Esimene();
		Teine teine = new Teine();
		FileInputStream fstream = new FileInputStream("src/fib.in");
		File file = new File("src/fib.out");
		BufferedWriter output;
		  DataInputStream in = new DataInputStream(fstream);
		  BufferedReader br = new BufferedReader(new InputStreamReader(in));
		  String strLine;
		  output = new BufferedWriter(new FileWriter(file));
		  while ((strLine = br.readLine()) != null)   {
			  numbers = Integer.parseInt(strLine);
			  output.write(Integer.toString(esimene.fib(numbers))+"\t");
			  output.write(Integer.toString(teine.fibi(numbers))+"\r\n");
		  }
		 output.close();
	}
	
}
